<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/details/winTimer.hpp 源文件</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_ae5bdaf1b45f3c0e6fd5dd3984d2eafd.html">details</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">winTimer.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d1/da6/win_timer_8hpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &lt;windows.h&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#include &lt;atomic&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &lt;mutex&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#include &quot;<a class="code" href="../../db/d24/itimer_8hpp.html">itimer.hpp</a>&quot;</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span> </div>
<div class="foldopen" id="foldopen00020" data-start="{" data-end="};">
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="../../dc/da9/classwin_timer.html">   20</a></span><span class="keyword">class </span><a class="code hl_class" href="../../dc/da9/classwin_timer.html">winTimer</a> : <span class="keyword">public</span> <a class="code hl_struct" href="../../d2/d38/structi_timer.html">iTimer</a></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span>{</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>    <span class="keyword">friend</span> <span class="keywordtype">void</span> CALLBACK <a class="code hl_friend" href="../../dc/da9/classwin_timer.html#a985d85e5d3680397f9cb5bd9871954f4">on_win_timer</a>(UINT <span class="keywordtype">id</span> , UINT msg , DWORD_PTR , <span class="keywordtype">void</span> * duser, DWORD_PTR dw1 , DWORD_PTR dw2 );</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="keyword">public</span>:</div>
<div class="foldopen" id="foldopen00024" data-start="{" data-end="};">
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="../../d0/d07/structwin_timer_1_1st_timer_item.html">   24</a></span>    <span class="keyword">struct </span><a class="code hl_struct" href="../../d0/d07/structwin_timer_1_1st_timer_item.html">stTimerItem</a>{</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad4759f33f98fc4292b41e1a60161e93c">   25</a></span>        MMRESULT     <a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad4759f33f98fc4292b41e1a60161e93c">m_id</a>;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad08e14e9ec530debf03684b7a2e6c112">   26</a></span>        <a class="code hl_class" href="../../dc/da9/classwin_timer.html">winTimer</a>   * <a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad08e14e9ec530debf03684b7a2e6c112">p_obj</a>;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#a2e1fe415b3afba22463ef37716002be3">   28</a></span>        <a class="code hl_function" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#a2e1fe415b3afba22463ef37716002be3">stTimerItem</a>():<a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad4759f33f98fc4292b41e1a60161e93c">m_id</a>( (MMRESULT)-1), <a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad08e14e9ec530debf03684b7a2e6c112">p_obj</a>( nullptr ){}</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#a80e59986f4dbf5e1868061957e2e976b">   29</a></span>        <a class="code hl_function" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#a80e59986f4dbf5e1868061957e2e976b">stTimerItem</a>( MMRESULT <span class="keywordtype">id</span> , <a class="code hl_class" href="../../dc/da9/classwin_timer.html">winTimer</a> * obj ):<a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad4759f33f98fc4292b41e1a60161e93c">m_id</a>( id ) , <a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad08e14e9ec530debf03684b7a2e6c112">p_obj</a>( obj ){}</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#a67ad8825edfa80d87e36df7fa323ed38">   30</a></span>        <a class="code hl_function" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#a67ad8825edfa80d87e36df7fa323ed38">stTimerItem</a>( <span class="keyword">const</span> <a class="code hl_struct" href="../../d0/d07/structwin_timer_1_1st_timer_item.html">stTimerItem</a>&amp; b ):<a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad4759f33f98fc4292b41e1a60161e93c">m_id</a>( b.<a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad4759f33f98fc4292b41e1a60161e93c">m_id</a> ),<a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad08e14e9ec530debf03684b7a2e6c112">p_obj</a>( b.<a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad08e14e9ec530debf03684b7a2e6c112">p_obj</a> ){}</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span> </div>
<div class="foldopen" id="foldopen00032" data-start="{" data-end="}">
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#af39de1cc2d630bd9966d24962d5d2ae6">   32</a></span>        <a class="code hl_struct" href="../../d0/d07/structwin_timer_1_1st_timer_item.html">stTimerItem</a>&amp; <a class="code hl_function" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#af39de1cc2d630bd9966d24962d5d2ae6">operator=</a>( <span class="keyword">const</span> <a class="code hl_struct" href="../../d0/d07/structwin_timer_1_1st_timer_item.html">stTimerItem</a>&amp; b )</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span>        {</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>            <a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad4759f33f98fc4292b41e1a60161e93c">m_id</a> = b.<a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad4759f33f98fc4292b41e1a60161e93c">m_id</a>;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span>            <a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad08e14e9ec530debf03684b7a2e6c112">p_obj</a> = b.<a class="code hl_variable" href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad08e14e9ec530debf03684b7a2e6c112">p_obj</a>;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>        }   </div>
</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>    };</div>
</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="../../dc/da9/classwin_timer.html#af7763b65d759068c4d779fae8ef4171d">   40</a></span>    <span class="keyword">static</span> std::map&lt; MMRESULT , winTimer * &gt;   <a class="code hl_variable" href="../../dc/da9/classwin_timer.html#af7763b65d759068c4d779fae8ef4171d">gTimerRecord</a>;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>    std::atomic&lt;bool&gt;           __m_is_one_shot;               <span class="comment">// 计时器是否是单次计时器</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>    std::atomic&lt;long&gt;           __m_tick;                      <span class="comment">// 最大计时量</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>    std::atomic&lt;bool&gt;           __m_is_run;                    <span class="comment">// 计时线程是否正在运行</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>    std::atomic&lt;bool&gt;           __m_reset;                     <span class="comment">// 复位计时器</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>    MMRESULT                    __m_id;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>    </div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>    std::mutex                  ___m_mutex;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span> </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>    std::function&lt;void(  )&gt;     __m_cb;                        <span class="comment">//要调用的事件发生的时候调用这个函数对象</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>    <span class="keywordtype">void</span> __on_sys_timer();</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>    <a class="code hl_function" href="../../dc/da9/classwin_timer.html#a14a1016e75bbce66e1e81223ebf97665">winTimer</a>();</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>    <a class="code hl_function" href="../../dc/da9/classwin_timer.html#a14a1016e75bbce66e1e81223ebf97665">winTimer</a>(<span class="keywordtype">long</span> ms , <span class="keywordtype">bool</span> oneShot );</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>    <a class="code hl_function" href="../../dc/da9/classwin_timer.html#a14a1016e75bbce66e1e81223ebf97665">winTimer</a>( std::function&lt;<span class="keywordtype">void</span>()&gt; fun , <span class="keywordtype">long</span> ms , <span class="keywordtype">bool</span> onShot = <span class="keyword">false</span> );</div>
<div class="foldopen" id="foldopen00058" data-start="{" data-end="}">
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="../../dc/da9/classwin_timer.html#acf8ffcaf3863e53e1d0a46e661b038d6">   58</a></span>    <a class="code hl_function" href="../../dc/da9/classwin_timer.html#acf8ffcaf3863e53e1d0a46e661b038d6">~winTimer</a>()</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>        {</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>        <span class="keywordflow">if</span>( __m_is_run == <span class="keyword">true</span> ){</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>            <a class="code hl_function" href="../../dc/da9/classwin_timer.html#a5761b4045da691f1b4be219414eb4d65">Stop</a>();</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>        }</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>    }</div>
</div>
<div class="foldopen" id="foldopen00067" data-start="{" data-end="}">
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="../../dc/da9/classwin_timer.html#af4ecf02c7dd3950a074813f12654b6a1">   67</a></span>    <span class="keyword">inline</span> <span class="keywordtype">long</span> <a class="code hl_function" href="../../dc/da9/classwin_timer.html#af4ecf02c7dd3950a074813f12654b6a1">operator()</a>()<span class="keyword">const</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span><span class="keyword">    </span>{</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>        <span class="keywordflow">return</span> __m_tick;</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>    }</div>
</div>
<div class="foldopen" id="foldopen00071" data-start="{" data-end="}">
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="../../dc/da9/classwin_timer.html#a1f51621daa57a92e70b44e65ed2d6556">   71</a></span>    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dc/da9/classwin_timer.html#a1f51621daa57a92e70b44e65ed2d6556">operator()</a>( <span class="keywordtype">long</span> t )</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>    { </div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>        __m_tick = t; </div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>    }</div>
</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>    <span class="keyword">virtual</span> <a class="code hl_enumeration" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5ab">emErrCode</a> <a class="code hl_function" href="../../dc/da9/classwin_timer.html#a8e3b9ffad7b759f2df399d8d222808cb">Start</a>( <span class="keywordtype">long</span> ms = -1, <span class="keywordtype">bool</span> oneShot = <span class="keyword">false</span> ) final;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>    virtual <span class="keywordtype">void</span> <a class="code hl_function" href="../../dc/da9/classwin_timer.html#a20ee41eb7e75beb6f68dfaf4343c87f8">SetOwner</a>( <a class="code hl_namespace" href="../../d8/dcc/namespacestd.html">std</a>::function&lt;<span class="keywordtype">void</span>(  )&gt; fun ) final;</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>    virtual <a class="code hl_enumeration" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5ab">emErrCode</a> <a class="code hl_function" href="../../dc/da9/classwin_timer.html#a5761b4045da691f1b4be219414eb4d65">Stop</a>(  ) final;</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>    virtual <span class="keywordtype">bool</span> <a class="code hl_function" href="../../dc/da9/classwin_timer.html#aceb8aba559f06550a0f9246091925410">IsRuning</a>(  ) final;</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span>    virtual <a class="code hl_enumeration" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5ab">emErrCode</a> <a class="code hl_function" href="../../dc/da9/classwin_timer.html#a756d1d8625064baaee44224298396633">Reset</a>() final;</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"><a class="line" href="../../dc/da9/classwin_timer.html#a9da570f1136b3a5f7b958077a58a72ae">   98</a></span>    virtual <span class="keywordtype">void</span> <a class="code hl_function" href="../../dc/da9/classwin_timer.html#a9da570f1136b3a5f7b958077a58a72ae">setTick</a>(<span class="keywordtype">long</span> t) final { __m_tick = t; }</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>};</div>
</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span> </div>
<div class="ttc" id="aclasswin_timer_html"><div class="ttname"><a href="../../dc/da9/classwin_timer.html">winTimer</a></div><div class="ttdoc">针对windows实现的timer</div><div class="ttdef"><b>定义</b> <a href="#l00020">winTimer.hpp:21</a></div></div>
<div class="ttc" id="aclasswin_timer_html_a14a1016e75bbce66e1e81223ebf97665"><div class="ttname"><a href="../../dc/da9/classwin_timer.html#a14a1016e75bbce66e1e81223ebf97665">winTimer::winTimer</a></div><div class="ttdeci">winTimer()</div><div class="ttdef"><b>定义</b> <a href="../../dd/da0/win_timer_8cpp_source.html#l00020">winTimer.cpp:20</a></div></div>
<div class="ttc" id="aclasswin_timer_html_a1f51621daa57a92e70b44e65ed2d6556"><div class="ttname"><a href="../../dc/da9/classwin_timer.html#a1f51621daa57a92e70b44e65ed2d6556">winTimer::operator()</a></div><div class="ttdeci">void operator()(long t)</div><div class="ttdef"><b>定义</b> <a href="#l00071">winTimer.hpp:71</a></div></div>
<div class="ttc" id="aclasswin_timer_html_a20ee41eb7e75beb6f68dfaf4343c87f8"><div class="ttname"><a href="../../dc/da9/classwin_timer.html#a20ee41eb7e75beb6f68dfaf4343c87f8">winTimer::SetOwner</a></div><div class="ttdeci">virtual void SetOwner(std::function&lt; void()&gt; fun) final</div><div class="ttdoc">指定事件响应函数，</div><div class="ttdef"><b>定义</b> <a href="../../dd/da0/win_timer_8cpp_source.html#l00071">winTimer.cpp:71</a></div></div>
<div class="ttc" id="aclasswin_timer_html_a5761b4045da691f1b4be219414eb4d65"><div class="ttname"><a href="../../dc/da9/classwin_timer.html#a5761b4045da691f1b4be219414eb4d65">winTimer::Stop</a></div><div class="ttdeci">virtual emErrCode Stop() final</div><div class="ttdoc">停止计时器</div><div class="ttdef"><b>定义</b> <a href="../../dd/da0/win_timer_8cpp_source.html#l00077">winTimer.cpp:77</a></div></div>
<div class="ttc" id="aclasswin_timer_html_a756d1d8625064baaee44224298396633"><div class="ttname"><a href="../../dc/da9/classwin_timer.html#a756d1d8625064baaee44224298396633">winTimer::Reset</a></div><div class="ttdeci">virtual emErrCode Reset() final</div><div class="ttdoc">复位计时，让计时器从零开始计时</div><div class="ttdef"><b>定义</b> <a href="../../dd/da0/win_timer_8cpp_source.html#l00100">winTimer.cpp:100</a></div></div>
<div class="ttc" id="aclasswin_timer_html_a8e3b9ffad7b759f2df399d8d222808cb"><div class="ttname"><a href="../../dc/da9/classwin_timer.html#a8e3b9ffad7b759f2df399d8d222808cb">winTimer::Start</a></div><div class="ttdeci">virtual emErrCode Start(long ms=-1, bool oneShot=false) final</div><div class="ttdoc">启动或者重启计时器。</div><div class="ttdef"><b>定义</b> <a href="../../dd/da0/win_timer_8cpp_source.html#l00043">winTimer.cpp:43</a></div></div>
<div class="ttc" id="aclasswin_timer_html_a985d85e5d3680397f9cb5bd9871954f4"><div class="ttname"><a href="../../dc/da9/classwin_timer.html#a985d85e5d3680397f9cb5bd9871954f4">winTimer::on_win_timer</a></div><div class="ttdeci">friend void CALLBACK on_win_timer(UINT id, UINT msg, DWORD_PTR, void *duser, DWORD_PTR dw1, DWORD_PTR dw2)</div><div class="ttdef"><b>定义</b> <a href="../../dd/da0/win_timer_8cpp_source.html#l00009">winTimer.cpp:9</a></div></div>
<div class="ttc" id="aclasswin_timer_html_a9da570f1136b3a5f7b958077a58a72ae"><div class="ttname"><a href="../../dc/da9/classwin_timer.html#a9da570f1136b3a5f7b958077a58a72ae">winTimer::setTick</a></div><div class="ttdeci">virtual void setTick(long t) final</div><div class="ttdef"><b>定义</b> <a href="#l00098">winTimer.hpp:98</a></div></div>
<div class="ttc" id="aclasswin_timer_html_aceb8aba559f06550a0f9246091925410"><div class="ttname"><a href="../../dc/da9/classwin_timer.html#aceb8aba559f06550a0f9246091925410">winTimer::IsRuning</a></div><div class="ttdeci">virtual bool IsRuning() final</div><div class="ttdoc">判断计时器是否正在运行</div><div class="ttdef"><b>定义</b> <a href="../../dd/da0/win_timer_8cpp_source.html#l00093">winTimer.cpp:93</a></div></div>
<div class="ttc" id="aclasswin_timer_html_acf8ffcaf3863e53e1d0a46e661b038d6"><div class="ttname"><a href="../../dc/da9/classwin_timer.html#acf8ffcaf3863e53e1d0a46e661b038d6">winTimer::~winTimer</a></div><div class="ttdeci">~winTimer()</div><div class="ttdef"><b>定义</b> <a href="#l00058">winTimer.hpp:58</a></div></div>
<div class="ttc" id="aclasswin_timer_html_af4ecf02c7dd3950a074813f12654b6a1"><div class="ttname"><a href="../../dc/da9/classwin_timer.html#af4ecf02c7dd3950a074813f12654b6a1">winTimer::operator()</a></div><div class="ttdeci">long operator()() const</div><div class="ttdoc">设置和获取计时器计时长度</div><div class="ttdef"><b>定义</b> <a href="#l00067">winTimer.hpp:67</a></div></div>
<div class="ttc" id="aclasswin_timer_html_af7763b65d759068c4d779fae8ef4171d"><div class="ttname"><a href="../../dc/da9/classwin_timer.html#af7763b65d759068c4d779fae8ef4171d">winTimer::gTimerRecord</a></div><div class="ttdeci">static std::map&lt; MMRESULT, winTimer * &gt; gTimerRecord</div><div class="ttdef"><b>定义</b> <a href="#l00040">winTimer.hpp:40</a></div></div>
<div class="ttc" id="aitimer_8hpp_html"><div class="ttname"><a href="../../db/d24/itimer_8hpp.html">itimer.hpp</a></div></div>
<div class="ttc" id="anamespacestd_html"><div class="ttname"><a href="../../d8/dcc/namespacestd.html">std</a></div><div class="ttdef"><b>定义</b> <a href="../../d1/d92/mandarava_2event_8hpp_source.html#l00038">event.hpp:39</a></div></div>
<div class="ttc" id="astructi_timer_html"><div class="ttname"><a href="../../d2/d38/structi_timer.html">iTimer</a></div><div class="ttdoc">定时器定义接口</div><div class="ttdef"><b>定义</b> <a href="../../db/d24/itimer_8hpp_source.html#l00014">itimer.hpp:15</a></div></div>
<div class="ttc" id="astructi_timer_html_a31bdd3250ca6c5542d0ec156bd82c5ab"><div class="ttname"><a href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5ab">iTimer::emErrCode</a></div><div class="ttdeci">emErrCode</div><div class="ttdef"><b>定义</b> <a href="../../db/d24/itimer_8hpp_source.html#l00016">itimer.hpp:17</a></div></div>
<div class="ttc" id="astructwin_timer_1_1st_timer_item_html"><div class="ttname"><a href="../../d0/d07/structwin_timer_1_1st_timer_item.html">winTimer::stTimerItem</a></div><div class="ttdef"><b>定义</b> <a href="#l00024">winTimer.hpp:24</a></div></div>
<div class="ttc" id="astructwin_timer_1_1st_timer_item_html_a2e1fe415b3afba22463ef37716002be3"><div class="ttname"><a href="../../d0/d07/structwin_timer_1_1st_timer_item.html#a2e1fe415b3afba22463ef37716002be3">winTimer::stTimerItem::stTimerItem</a></div><div class="ttdeci">stTimerItem()</div><div class="ttdef"><b>定义</b> <a href="#l00028">winTimer.hpp:28</a></div></div>
<div class="ttc" id="astructwin_timer_1_1st_timer_item_html_a67ad8825edfa80d87e36df7fa323ed38"><div class="ttname"><a href="../../d0/d07/structwin_timer_1_1st_timer_item.html#a67ad8825edfa80d87e36df7fa323ed38">winTimer::stTimerItem::stTimerItem</a></div><div class="ttdeci">stTimerItem(const stTimerItem &amp;b)</div><div class="ttdef"><b>定义</b> <a href="#l00030">winTimer.hpp:30</a></div></div>
<div class="ttc" id="astructwin_timer_1_1st_timer_item_html_a80e59986f4dbf5e1868061957e2e976b"><div class="ttname"><a href="../../d0/d07/structwin_timer_1_1st_timer_item.html#a80e59986f4dbf5e1868061957e2e976b">winTimer::stTimerItem::stTimerItem</a></div><div class="ttdeci">stTimerItem(MMRESULT id, winTimer *obj)</div><div class="ttdef"><b>定义</b> <a href="#l00029">winTimer.hpp:29</a></div></div>
<div class="ttc" id="astructwin_timer_1_1st_timer_item_html_ad08e14e9ec530debf03684b7a2e6c112"><div class="ttname"><a href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad08e14e9ec530debf03684b7a2e6c112">winTimer::stTimerItem::p_obj</a></div><div class="ttdeci">winTimer * p_obj</div><div class="ttdef"><b>定义</b> <a href="#l00026">winTimer.hpp:26</a></div></div>
<div class="ttc" id="astructwin_timer_1_1st_timer_item_html_ad4759f33f98fc4292b41e1a60161e93c"><div class="ttname"><a href="../../d0/d07/structwin_timer_1_1st_timer_item.html#ad4759f33f98fc4292b41e1a60161e93c">winTimer::stTimerItem::m_id</a></div><div class="ttdeci">MMRESULT m_id</div><div class="ttdef"><b>定义</b> <a href="#l00025">winTimer.hpp:25</a></div></div>
<div class="ttc" id="astructwin_timer_1_1st_timer_item_html_af39de1cc2d630bd9966d24962d5d2ae6"><div class="ttname"><a href="../../d0/d07/structwin_timer_1_1st_timer_item.html#af39de1cc2d630bd9966d24962d5d2ae6">winTimer::stTimerItem::operator=</a></div><div class="ttdeci">stTimerItem &amp; operator=(const stTimerItem &amp;b)</div><div class="ttdef"><b>定义</b> <a href="#l00032">winTimer.hpp:32</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
